﻿package com.woniuxy.main.util;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016100200646407";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCNbA/pJ5mbQE9g70X56QutuN21UOOABkEfyOtUmFoUfGT2g8NfD3vi6MtFVpoQ4XxMFUesbCIds9hR7KZtFaDt62peLjlRQNOr4EAatT/J08Fp4xKYw4Dr3gsDuzUsF0YGCHksIub3x5oHoF49MuozsU/l9+JXks5tce/FzVyDMT/mlPmunPp9jTx5l5fCeFt/UhmzUIHfZA2gv9dmbUjDjyS4bqzR6Ki5RQSEoImtXUNi7NWAOVUP16NLkHUBG377I61Mlly63SKYIXZCNNs13XYZiKux0CeUuNVicYZ9f7YjmyRSAI9JoT3DdpZw6D/UXmqTs/UQjQ3JyVE7gy61AgMBAAECggEAa+SIkvmKQB6lMK/7c/ku1r+WLfFjT1X2M1im6Wg+OSjaIhROZmS6wFeYVPMIIV7V5HnLr6jjskN2ArKIGesJVtpm0Sl0wx+xHYy9e2LSIplyEuWRV4i3/7rsLlGR9GxhGNM4Fssd6OWYBr97hjck5IEfErS2Mtems2rcYc0WCmPQ/yTsdr+a2nVq2t2ay4nesE5lgxdKHz3wbkW//nRXkNHGu7k+jiilkZjE0pOTbvPKpC98ogQcSjkiol5JSoLP+5Fe9T0ecxlHGl/eDMJmxafLnemCuiKHebRWwtsE4fppo7Yw6rMwLaBAY6zhmCRHpABOId/joePBBl7mG/+SVQKBgQDW7OMQ1sZlshN68tQ7z/9J/fxI1kZGYS2e/zTnl9euXvFk5/+nFTWCY/mzJzZqXfeZL4CC1NXp23Qs34OdShS96CyKPJtF+NxcqfaGd3uFYVpRqbYRAVFScMdAxymU6RGbn+Y5StVPG4lGzY0alC7sWmQmglVxu2KMRNPK6VlffwKBgQCocxFAwxdY8hRtcqDnEeGf9K+BcWqbY8rmxJ1PudYE3V9AHxQdEo16OD2zioVGLzNl07+NFlfuzMAXUZcCpeYsJho+KPYeboa5aInPXPJYSugYECHmsF26Xb7WgFR2soZIW/cgxjb8ke7z3QGo2jiJQGBxJPF3tMBSEMy5qnYLywKBgQCYXCf/2PGeSCYNI7WWjTXhwz6kd9orrFpF+48KmpbYUw/3Q4v1a1Calbr+6M5niyOqIYWNucnHVb4+zVilGU4o7j0c5igA65Fz0z0jR/J1tHTtrUyXM4Lt2Ws3Hbj5ilvkIe94L/eVc+TWH4NnEyNMhCu5LO3biUYsP+KQVun3iwKBgHnc5PppKRbb6xNS/jysnwHNTrrihjFsfHl+fCAVXVOfoy0MTszJgziMP3cIG2qu8wwTqFw1cd/8mGtGR21O/7moxwt5LrTNWQIBMtGleF2Ps2DVKvFtXiFZeJpNtM06UhM/FQXM4DLQkIIzvOOfG4+P1zWDeH0VcpzsMm+Pdl8JAoGAF37JGOLxeJ8H8ARhtXESmzSLHmF8HOkzEj8rwRS3VCi2ckC2Y/Mz0cbtemUREVRZ/8OpG6RCKLUJU2cIEn9O43DIJpHThkyZLBOxDBVdDCaAQc8fYuD+T4SraRZc9juJf+gKDdgDdk4MuaTggRWyXv0qRa+yPNG9ARW2KQRrjeA=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnw7qfYh9OWnJed6099LtSVEQ7LwRbVw8DzzaHKn97goyjISCGX0wzzWUhZZHlTX//7ulQXoRo85m5lfjdlMDCFR8pAOBKWO+W29KEJf83kVOwxchKo/NiLqzOTmbsrGTo0OPOh/o2KuRNIipdKCCqU+FlFym3N71RjMUr6aDPA+ukD+mYIb/n9VDhisrYCteg9zwMlJ+F8EBZmy+AGoYvXeaw3nKSrgLmam2/ScD2jdPQQx3zLRdIc6u7+NgTd80/X1dSNEPc6iOd/mamPB8DXp+i65pBitDxC4muOpggrfu5YJx/Q6XzXyd3dOSIU05qewknG5HUT79sndtfGYE1QIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://25c521j135.wicp.vip/recharge/notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://25c521j135.wicp.vip/recharge/synReturn";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

